package com.useeinfo.oa.modules.base.entity;

import com.alibaba.fastjson.JSONObject;
import com.useeinfo.framework.extend.entity.SuperClassEntity;
import com.useeinfo.oa.modules.security.entity.SystemUser;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @program: YiYouFuPlatform
 * @author: Taogq
 * @createDate: 2018-12-06
 * @createTime: 14:24:50
 * 企业中普通用户和系统用户的关联关系
 */
@Entity
@Table(name = "EnterprisePersonnelSystemUser")
public class EnterprisePersonnelSystemUser extends SuperClassEntity<EnterprisePersonnelSystemUser> {

    /**
     * 所属企业
     */
    @ManyToOne
    @JoinColumn(name = "enterprise_id")
    private Enterprise enterprise;
    /**
     * 普通人员
     */
    @ManyToOne
    @JoinColumn(name = "personnel_id")
    private Personnel personnel;

    /**
     * 系统用户
     */
    @ManyToOne
    @JoinColumn(name = "systemUser_id")
    private SystemUser systemUser;

    public Enterprise getEnterprise() {
        return enterprise;
    }

    public void setEnterprise(Enterprise enterprise) {
        this.enterprise = enterprise;
    }

    public Personnel getPersonnel() {
        return personnel;
    }

    public void setPersonnel(Personnel personnel) {
        this.personnel = personnel;
    }

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    @Override
    public JSONObject toJSONObject() {
        return super.toJSONObject();
    }
    
}
